@Component
public class JWTFilter extends OncePerRequestFilter {
    // ...
    @Override
    protected void doFilterInternal(
        HttpServletRequest httpServletRequest,
        HttpServletResponse httpServletResponse,
        FilterChain filterChain)
            throws ServletException, IOException {
        // extract token from request
        if ( /* token is not empty */ ) {
            // try to get user from redis cache
            if ( /* token is valid for a specific user */ ) {
                // create a new authentication object
                // and set it into Spring security context
                // extends token expiration
            }
        }
        filterChain.doFilter(httpServletRequest,
                             httpServletResponse);
    }
}
